// phalanx remove_move_reference.hpp.cu header file

// Copyright (c) 2010 - 2011 Kohei Takahashi (Flast).
// Distributed under the MIT license. for more detail see COPYING.

#ifndef IG_PHALANX_MOVE_DETAIL_REMOVE_MOVE_REFERENCE_HPP_CU_ONCE_
#define IG_PHALANX_MOVE_DETAIL_REMOVE_MOVE_REFERENCE_HPP_CU_ONCE_

#include <phalanx/config.hpp.cu>

#include <phalanx/move/detail/rvalue.hpp.cu>
#include <phalanx/move/detail/is_move_reference.hpp.cu>

#include <phalanx/utility/identity.hpp.cu>

namespace phalanx
{

namespace move_detail
{

template < bool, typename T >
struct _remove_moveref_impl
  : public identity< T > {};

template < typename T >
struct _remove_moveref_impl< true, rv_< T > & >
  : public identity< T > {};

template < typename T >
struct _remove_moveref_impl< true, const rv_< T > & >
  : public identity< const T > {};

template < typename T >
struct _remove_moveref_impl< true, volatile rv_< T > & >
  : public identity< volatile T > {};

template < typename T >
struct _remove_moveref_impl< true, const volatile rv_< T > & >
  : public identity< const volatile T > {};

template < typename T >
struct remove_move_reference
  : public _remove_moveref_impl<
      is_move_reference< T >::value,
      T > {};

} // namespace move_detail

} // namespace phalanx

#endif // IG_PHALANX_MOVE_DETAIL_REMOVE_MOVE_REFERENCE_HPP_CU_ONCE_

